package com.xh.demo.feign.config;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author wen
 * @apiNote 自定义feign拦截器
 * @since 2021-12-11
 */
@Slf4j
// 此处如果加入@Component注解，FeignInterceptor当前拦截器将被所有feign共享
public class FeignInterceptor implements RequestInterceptor {

    @Override
    public void apply(RequestTemplate requestTemplate) {
        log.info("【自定义feign拦截器】【{}】", requestTemplate.path());
    }

}
